 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.viettel.core.dao.cms.UsersDAO;
import com.viettel.core.entities.cms.Users;
import com.viettel.core.entities.vo.UsersSearchFilter;
import com.viettel.core.entities.vo.UsersSearchVO;
import com.viettel.core.exceptions.BusinessException;
import com.viettel.core.exceptions.DataAccessException;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 10:50:59
   */
 public class UsersMgrImpl implements UsersMgr{ 
	@Autowired 
	UsersDAO usersDAO; 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public Users getUsersById(Integer id) throws BusinessException { 
		try { 
			return  usersDAO.getUsersById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public Users createUsers(Users users) throws BusinessException { 
		try { 
			return usersDAO.createUsers(users); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateUsers(Users users) throws BusinessException { 
		try { 
			usersDAO.updateUsers(users); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteUsers(Users users) throws BusinessException { 
		try { 
			usersDAO.deleteUsers(users); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public Boolean checkPhoneExist(String phone) throws BusinessException {
		try { 
			return usersDAO.checkPhoneExist(phone); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override
	public Boolean checkPhoneExists(String phone) throws BusinessException {
		try { 
			return usersDAO.checkPhoneExists(phone); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override
	public List<UsersSearchVO> getListSearchUsersByFilter(
			UsersSearchFilter filter) throws BusinessException {
		try { 
			return usersDAO.getListSearchUsersByFilter(filter);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<Users> getListUsersByPhone(String phone, Integer maxRows)
			throws BusinessException {
		try { 
			return usersDAO.getListUsersByPhone(phone, maxRows);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		}
	}

	@Override
	public List<Users> getUsersByPhone(String phone) throws BusinessException {
		try { 
			return usersDAO.getUsersByPhone(phone);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		}
	} 
} 
